import 'package:wallet_utils/bean/login_bean.dart';
import 'package:wallet_utils/login_utils.dart';
import 'package:shared_preferences/shared_preferences.dart';

/// @author: pengboboer
/// @createDate: 2022/1/13
String? businessId;
String? businessLoginId;
String? marketId;
String? userName;
String? userPhone;
String? businessName;

class TestUserManager {
  static Future<SharedPreferences> init() async {
    LoginBean loginBean = LoginBean.fromJson(await LoginUtils.getLoginBean());
    SharedPreferences sp = await SharedPreferences.getInstance();
    businessId = await LoginUtils.getBusinessId();
    businessLoginId = await LoginUtils.getBusinessLoginId();
    marketId = await LoginUtils.getMarketId();
    userName = loginBean.data!.nickname;
    userPhone = await LoginUtils.getUserPhone();
    businessName = await LoginUtils.getBusinessName();
    return sp;
  }
}
